<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>动画平滑</title>
    <style>
      body {
        margin: 0;
        padding: 0;
      }
      #app {
        padding: 15px;
      }
      .observer-item {
        margin-bottom: 50px;
        height: 200px;
        color: #fff;
        line-height: 200px;
        text-align: center;
      }
      .box1 {
        background-color: pink;
      }
      .box2 {
        background-color: skyblue;
      }
      .come-in {
        opacity: 1;
        transform: translateY(150px);
        animation: come-in 1s ease forwards;
      }

      .come-in:nth-child(odd) {
        animation-duration: 1s;
      }
      .opaque {
        opacity: 0;
      }

      @keyframes come-in {
        100% {
          transform: translateY(0);
        }
      }
    </style>
  </head>
  <body>
    <section id="app">
      <div class="box1 observer-item">content-1</div>
      <div class="box2 observer-item">content-2</div>
      <div class="box1 observer-item">content-3</div>
      <div class="box2 observer-item">content-4</div>
      <div class="box1 observer-item">content-5</div>
      <div class="box2 observer-item">content-6</div>
      <div class="box1 observer-item">content-7</div>
      <div class="box2 observer-item">content-8</div>
      <div class="box1 observer-item">content-9</div>
      <div class="box2 observer-item">content-10</div>
      <div class="box1 observer-item">content-11</div>
      <div class="box2 observer-item">content-12</div>
      <div class="box1 observer-item">content-13</div>
      <div class="box2 observer-item">content-14</div>
      <div class="box1 observer-item">content-15</div>
    </section>

    <script src="./observerItem.js"></script>
  </body>
</html>
